﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ATW.MT.BUS;
using System.Data;
using ATW.MT.CommonClass;

namespace ATW.MT.RequireManage
{

    public partial class RequireDetail : System.Web.UI.Page
    {
        bus_T_DemandInformation info = new bus_T_DemandInformation();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();
            }
        }
        private void BindData()
        {
            try
            {
                string id = Request.QueryString["did"];

                if (!string.IsNullOrEmpty(id) && common.filterChar(id))
                {
                    DataTable dt = info.DemandDetail(id);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        lblTitle.Text = dt.Rows[0]["tdititle"].ToString();
                        lblType.Text = dt.Rows[0]["tditype"].ToString();
                        lblCatName.Text = dt.Rows[0]["ticName"].ToString();
                        lblDetail.Text = dt.Rows[0]["tdidesc"].ToString();
                        lblPublishTime.Text = dt.Rows[0]["tdiPublishTime"].ToString();
                        lblCloseTime.Text = dt.Rows[0]["tdiCloseTime"].ToString();
                        lblName.Text = dt.Rows[0]["tauName"].ToString();
                        lblStatus.Text = dt.Rows[0]["tdirowstatus"].ToString();
                        lblDeliver.Text = dt.Rows[0]["tdiAdditional1"].ToString() + dt.Rows[0]["tdiAdditional2"].ToString();
                        rpList.DataSource = dt;
                        rpList.DataBind();
                    }
                }
            }
            catch (Exception ex)
            {

            }
        }
        public string subStr(string s, int maxLen)
        {
            if (s.Length >= maxLen)
            {
                return s.Substring(0, maxLen - 3) + "...";
            }
            return s;
        }
    }
}